package com.simple.core.impl;

import cn.hutool.core.util.ReflectUtil;
import com.simple.core.AbsReceiver;
import com.simple.core.Carrier;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.lang.reflect.Method;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class EnhanceReceiver extends AbsReceiver {

    private Object instance;

    private Method method;

    @Override
    public <T> T receive(Carrier carrier) {
        return ReflectUtil.invoke(instance, method, carrier);
    }
}
